package answer_factory;

import answers.IAnswer;
import answers.ShortAnswer;

public class ShortAnswerFactory implements IAnswerFactory
{

	@Override
	public IAnswer createAnswer(String encoding)
	{
		String [] tokens = encoding.split("\\s");
		String answerText = new String();
		for(int i = 2 ; i < tokens.length; ++i)
		{
			answerText += tokens[i] + " ";
		}
		
		return new ShortAnswer(answerText);
	}

}
